home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.470 < prev    next >
Text File  |  1996-02-12  |  28KB  |  696 lines

  1. Frequently Asked Questions (FAQS);faqs.470
  2.  
  3.  
  4.  
  5. You can demonstrate this with a tray, which you hold in your right hand
  6. with the arm lowered, then rotate twice as you raise your arm and end
  7. up with the tray above your head, rotated twice about its vertical
  8. axis, but without having twisted your arm.
  9.  
  10. Also, by attaching strings to a sphere, it is possible to see that a
  11. 360 degree rotation will entangle the strings, which another 360 degree
  12. rotation will disentangle.
  13.  
  14. Hospitals have machines which take out your blood, centrifuge it to take out
  15. certain parts, then return it to your veins. Because of AIDS they must never
  16. let your blood touch the inside of the machine which has touched others'
  17. blood. So the inside is lined with a single piece of disposable branched
  18. plastic tubing. This tube must rotate rapidly in the centrifuge where
  19. several branches come out. Thus the tube should twist and tangle up the
  20. branches. But the machine untwists the branches as in the above discussion.
  21. At several hundred rounds per minute!
  22.  
  23. References
  24.     P. A. M. Dirac's "scissors demonstration"
  25.     R. Penrose and W.  Rindler
  26.     Spinors and Space-time, vol. 1, p. 43
  27.     Cambridge University Press, 1984,
  28.  
  29.     R. Feynman and S. Weinberg
  30.     Elementary Particles and the Laws of Physics, p. 29
  31.     Cambridge University Press, 1987
  32.  
  33. ==> geometry/smuggler.p <==
  34. Somewhere on the high sees smuggler S is attempting, without much
  35. luck, to outspeed coast guard G, whose boat can go faster than S's. G
  36. is one mile east of S when a heavy fog descends. It's so heavy that
  37. nobody can see or hear anything further than a few feet. Immediately
  38. after the fog descends, S changes course and attempts to escape at
  39. constant speed under a new, fixed course. Meanwhile, G has lost track
  40. of S. But G happens to know S's speed, that it is constant, and that S
  41. is sticking to some fixed heading, unknown to G.
  42.  
  43. How does G catch S?
  44.  
  45. G may change course and speed at will. He knows his own speed and
  46. course at all times. There is no wind, G does not have radio or radar,
  47. there is enough space for maneuvering, etc.
  48.  
  49. ==> geometry/smuggler.s <==
  50. One way G can catch S is as follows (it is not the fastest way).
  51.  
  52. G waits until he knows that S has traveled for one mile. At that time, both
  53. S and G are somewhere on a circle with radius one mile, and with its center
  54. at the original position of S. G then begins to travel with a velocity that
  55. has a radially outward component equal to that of S, and with a tangential
  56. component as large as possible, given G's own limitation of total speed. By
  57. doing so, G and S will always both be on an identical circle having its
  58. center at the original position of S. Because G has a tangential component
  59. whereas S does not, G will always catch S (actually, this is not proven
  60. until you solve the o.d.e. associated with the problem).
  61.  
  62. If G can go at 40 mph and S goes at 20 mph, you can work out that it will
  63. take G at most 1h 49m 52s to catch S.  On average, G will catch S in:
  64.  
  65. ( -2pi + sqrt(3) ( exp(2pi/sqrt(3)) - 1 )) / 40pi    hours,
  66.  
  67. which is, 27 min and 17 sec.
  68.  
  69. ==> geometry/table.in.corner.p <==
  70. Put a round table into a (perpendicular) corner so that the table top
  71. touches both walls and the feet are firmly on the ground.  If there is
  72. a point on the perimeter of the table, in the quarter circle between
  73. the two points of contact, which is 10 cm from one wall and 5 cm from
  74. the other, what's the diameter of the table?
  75.  
  76. ==> geometry/table.in.corner.s <==
  77. Consider the +X axis and the +Y axis to be the corner.  The table has
  78. radius r which puts the center of the circle at (r,r) and makes the
  79. circle tangent to both axis.  The equation of the circle (table's
  80. perimeter) is
  81.  
  82.     (x-r)^2 + (y-r)^2 = r^2 .
  83.  
  84. This leads to
  85.  
  86.      r^2 - 2(x+y) + x^2 + y^2 = 0
  87.  
  88. Using x = 10, y = 5 we get the solutions 25 and 5.  The former is the
  89. radius of the table.  It's diameter is 50 cm.
  90.  
  91. The latter number is the radius of a table that has a point which
  92. satisfies the conditions but is on the outside edge of the table.
  93.  
  94. ==> geometry/tesseract.p <==
  95. If you suspend a cube by one corner and slice it in half with a
  96. horizontal plane through its centre of gravity, the section face is a
  97. hexagon.  Now suspend a tesseract (a four dimensional hypercube) by one
  98. corner and slice it in half with a hyper-horizontal hyperplane through
  99. its centre of hypergravity.  What is the shape of the section
  100. hyper-face?
  101.  
  102. ==> geometry/tesseract.s <==
  103. The 4-cube is the set of all points in [-1,1]^4 .
  104. The hyperplane { (x,y,z,w) : x + y + z + w = 0 } cuts the 4-cube
  105. in the desired manner.
  106.  
  107. Now, { (.5,.5,-.5,-.5), (.5,-.5,.5,-.5), (.5,-.5,-.5,.5) } is an
  108. orthonormal basis for the hyperplane.  Let (a,b,c) be a point on the
  109. hyperplane with respect to this basis.  (a,b,c) is in the 4-cube if and
  110. only if |a| + |b| + |c| <= 2.   The shape of the intersection is a
  111. regular octahedron.
  112.  
  113. ==> geometry/tetrahedron.p <==
  114. Suppose you have a sphere of radius R and you have four planes that are
  115. all tangent to the sphere such that they form an arbitrary tetrahedron
  116. (it can be irregular).  What is the ratio of the surface area of the
  117. tetrahedron to its volume?
  118.  
  119. ==> geometry/tetrahedron.s <==
  120. For each face of the tetrahedron, construct a new tetrahedron with that
  121. face as the base and the center of the sphere as the fourth vertex.
  122. Now the original tetrahedron is divided into four smaller ones, each of
  123. height R.  The volume of a tetrahedron is Ah/3 where A is the area of
  124. the base and h the height; in this case h=R.  Combine the four
  125. tetrahedra algebraically to find that the volume of the original
  126. tetrahedron is R/3 times its surface area.
  127.  
  128. ==> geometry/tiling/rational.sides.p <==
  129. A rectangular region R is divided into rectangular areas.  Show that if
  130. each of the rectangles in the region has at least one side with
  131. rational length then the same can be said of R.
  132.  
  133. ==> geometry/tiling/rational.sides.s <==
  134. "Fourteen proofs of a result about tiling a rectangle" (Stan Wagon)
  135. _The American Mathematical Monthly_, Aug-Sep 1987, Vol 94 #7.  There
  136. was also a fifteenth proof published a few issues later, attributed to
  137. a (University of Kentucky?) student.
  138.  
  139. ==> geometry/tiling/rectangles.with.squares.p <==
  140. Given two sorts of squares, (axa) and (bxb), what rectangles can be tiled?
  141.  
  142. ==> geometry/tiling/rectangles.with.squares.s <==
  143. A rectangle can be tiled with (axa) and (bxb) squares,   iff
  144.  
  145. (i) gcd(a,b)=1 , and any of the following hold:
  146.  
  147. either:  both sides of the rectangle are multiples of a;
  148.     or:  both sides of the rectangle are multiples of b;
  149.     or:  one side is a multiple of (ab), and the other is any length EXCEPT
  150.          one of a finite number of "bad" lengths: those numbers which are
  151.          NOT positive integer combinations of a & b. { By Sylvester's theorem
  152.          there are (a-1)(b-1)/2 of these, the largest being (a-1)(b-1)-1. }
  153.  
  154. (ii) gcd(a,b) = d .
  155.      Then merely apply (i) to the problem with a,b replaced
  156.      by a/d, b/d  and the rectangle lengths also divided by d.
  157.      i.e.  all cells must appear in (dxd) subsquares.
  158.  
  159. ------
  160. PROOF
  161. It is clear that (ii) follows from (i), and that simple constructions give
  162. the "if" part of (i). For the "only if" part, we prove that...
  163.  
  164. (S) If one side of the rectangle is not divisible by a, and the other is
  165.     not divisible by b, then the tiling is impossible.
  166.  
  167. The results in (i) follow immediately from (S).
  168.  
  169. To prove (S):  ( Chakraborty-Hoey style ).
  170.                  ~~~~~~~~~~~~~~~~
  171. Let the width of the rectangle be a NON-(a-multiple). Then the number of
  172. bxb squares starting (i.e. top edge) at row 1 must be a NON-a-multiple.
  173. Thus the number of bxb starting at row 2 must BE an a-multiple. Similarly
  174. for the number starting at rows 3,4,...,b . Then the number starting at
  175. row (b+1) must be a NON-a-multiple again.
  176.  
  177. Similarly the number starting at rows (2b+1), (3b+1), (4b+1),... must all be
  178. non-a-multiples. So if the number of rows is NOT a multiple of b, (call it
  179. bx+r), then row (bx+1) must have a NON-a-multiple of bxb squares starting
  180. there, i.e. at least one, and there is no room left to squeeze it in.     [QED]
  181. ----
  182.  
  183. A Rickard-style proof of (S) is    ..BBB....BBWWW...WBBB....BBWWW...W(..etc)
  184.   ~~~~~~~   also possible, by      ..BBB....BBWWW...WBBB....BBWWW...W
  185. coloring the rectangle in          ..BBB....BBWWW...WBBB....BBWWW...W
  186. vertical strips as shown here:       <-  a  ->< b-a ><-  a  ->< b-a >
  187.  
  188. Every square tile covers an a-multiple of black squares. But if the width
  189. is a NON-b-multiple, and the number of rows is a NON-a-multiple, then there
  190. are a NON-a-multiple of black squares in total.    [QED]
  191.  
  192. (Note: the coloring must have 1 column of blacks on the right, and any
  193.  ====     spare columns of whites on the left.)
  194.  
  195. ===================
  196.  
  197. Bill Taylor.            wft@math.canterbury.ac.nz
  198.  
  199. >A Rickard-style proof of (S) is    ..BBB....BBWWW...WBBB....BBWWW...W(..etc)
  200. >  ~~~~~~~   also possible, by      ..BBB....BBWWW...WBBB....BBWWW...W
  201. >coloring the rectangle in          ..BBB....BBWWW...WBBB....BBWWW...W
  202. >vertical strips as shown here:       <-  a  ->< b-a ><-  a  ->< b-a >
  203. >
  204. >Every square tile covers an a-multiple of black squares. But if the width
  205. >is a NON-b-multiple, and the number of rows is a NON-a-multiple, then there
  206. >are a NON-a-multiple of black squares in total.    [QED]
  207. >
  208. >(Note: the coloring must have 1 column of blacks on the right, and any
  209. > ====     spare columns of whites on the left.)
  210.  
  211. This statement of how to position the colouring isn't good enough, I'm
  212. afraid. Take a=4, b=7 and consider e.g. a 19x10 rectangle. Coloured your
  213. way, you get:
  214.  
  215.     BWWWBBBBWWWBBBBWWWB
  216.     BWWWBBBBWWWBBBBWWWB
  217.     :::::::::::::::::::
  218.     BWWWBBBBWWWBBBBWWWB
  219.     BWWWBBBBWWWBBBBWWWB
  220.  
  221. The result has 10*10=100 black squares in it, which *is* a multiple of a=4,
  222. despite the fact that 19 is not a multiple of 7 and 10 is not a multiple of
  223. 4.
  224.  
  225. Of course, there is an alternative offset for the pattern that does give you
  226. the result you want:
  227.  
  228.     WWBBBBWWWBBBBWWWBBB
  229.     WWBBBBWWWBBBBWWWBBB
  230.     :::::::::::::::::::
  231.     WWBBBBWWWBBBBWWWBBB
  232.     WWBBBBWWWBBBBWWWBBB
  233.  
  234. To show this happens in general: because the width of the rectangle is a
  235. non-multiple of b, it is possible to position it on the pattern so that the
  236. leftmost column in the rectangle is white and the column just right of the
  237. right edge of the rectangle is black. Suppose N columns are black with this
  238. positioning. Then the rectangle contains N*H black cells, where H is the
  239. height of the rectangle.
  240.  
  241. If we then shift the rectangle right by one, the number of black columns
  242. increases by 1 and it contains (N+1)*H black cells. The difference between
  243. these two numbers of black cells is H, which is not a multiple of a.
  244. Therefore N*H and (N+1)*H cannot both be multiples of a, and so one of these
  245. two positionings of the pattern will suit your purposes.
  246.  
  247. David Seal
  248. dseal@armltd.co.uk
  249.  
  250. ==> geometry/tiling/scaling.p <==
  251. A given rectangle can be entirely covered (i.e. concealed) by an
  252. appropriate arrangement of 25 disks of unit radius.
  253.  
  254. Can the same rectangle be covered by 100 disks of 1/2 unit radius?
  255.  
  256. ==> geometry/tiling/scaling.s <==
  257. Yes.  The same configuration of circles, when every distance is reduced
  258. by half (including the diameters), will cover a similar rectangle whose
  259. sides are one half of the original one.  The original rectangle is the
  260. union of four such rectangles.
  261.  
  262. ==> geometry/tiling/seven.cubes.p <==
  263. Consider 7 cubes of equal size arranged as follows. Place 5 cubes so
  264. that they form a Swiss cross or a + (plus). ( 4 cubes on the sides and
  265. 1 in the middle). Now place one cube on top of the middle cube and the
  266. seventh below the middle cube, to effectively form a 3-dimensional
  267. swiss cross.
  268.  
  269. Can a number of such blocks (of 7 cubes each) be arranged so that they
  270. are able to completely fill up a big cube (say 10 times the size of
  271. the small cubes)? It is all right if these blocks project out of the
  272. big cube, but there should be no holes or gaps.
  273.  
  274. ==> geometry/tiling/seven.cubes.s <==
  275. Let n be a positive integer.  Define the function f from Z^n to Z by
  276. f(x) = x_1+2x_2+3x_3+...+nx_n.  For x in Z^n, say y is a neighbor of x
  277. if y and x differ by one in exactly one coordinate.  Let S(x) be the
  278. set consisting of x and its 2n neighbors.  It is easy to check that
  279. the values of f(y) for y in S(x) are congruent to 0,1,2,...,2n+1 (mod
  280. 2n+1) in some order.  Using this, it is easy to check that every y in
  281. Z^n is a neighbor of one and only one x in Z^n such that f(x) is
  282. congruent to 0 (mod 2n+1).  So Z^n can be tiled by clusters of the
  283. form S(x), where f(x) is congruent to 0 mod 2n+1.
  284.  
  285. ==> group/group.01.p <==
  286. AEFHIKLMNTVWXYZ BCDGJOPQRSU
  287.  
  288. ==> group/group.01.s <==
  289. AEFHIKLMNTVWXYZ    drawn with straight lines
  290. BCDGJOPQRSU    not drawn with straight lines
  291.  
  292. ==> group/group.01a.p <==
  293. 147 0235689
  294.  
  295. ==> group/group.01a.s <==
  296. 147    drawn with straight lines
  297. 0235689    not drawn with straight lines
  298.  
  299. ==> group/group.02.p <==
  300. ABEHIKMNOPTXZ CDFGJLQRSUVWY
  301.  
  302. ==> group/group.02.s <==
  303. ABEHIKMNOPTXZ    resembles Greek letter
  304. CDFGJLQRSUVWY    does not resemble Greek letter
  305.  
  306. ==> group/group.03.p <==
  307. BEJQXYZ DFGHLPRU KSTV CO AIW MN
  308.  
  309. ==> group/group.03.s <==
  310.  
  311. BEJQXYZ            no state starting with this letter
  312. DFGHLPRU        one state starting with this letter
  313. KSTV            two states starting with this letter
  314. CO            three states starting with this letter
  315. AIW            four states starting with this letter
  316.             five states starting with this letter
  317.             six states starting with this letter
  318.             seven states starting with this letter
  319. MN            eight states starting with this letter
  320.  
  321. ==> group/group.04.p <==
  322. BDO P ACGJLMNQRSUVWZ EFTY HIKX
  323.  
  324. ==> group/group.04.s <==
  325. BDO        no endpoint
  326. P        one endpoint
  327. ACGJLMNQRSUVWZ    two endpoints
  328. EFTY        three endpoints
  329. HIKX        four endpoints
  330.  
  331. ==> group/group.05.p <==
  332. CEFGHIJKLMNSTUVWXYZ ADOPQR B
  333.  
  334. ==> group/group.05.s <==
  335. CEFGHIJKLMNSTUVWXYZ    no enclosed area
  336. ADOPQR            one enclosed area
  337. B            two enclosed areas
  338.  
  339. ==> group/group.06.p <==
  340. BCEGKMQSW DFHIJLNOPRTUVXYZ
  341.  
  342. ==> group/group.06.s <==
  343. BCEGKMQSW        prime numbers
  344. DFHIJLNOPRTUVXYZ    composites
  345.  
  346. Xref: bloom-picayune.mit.edu rec.puzzles:18146 news.answers:3077
  347. Newsgroups: rec.puzzles,news.answers
  348. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!snorkelwacker.mit.edu!usc!wupost!spool.mu.edu!uunet!questrel!chris
  349. From: uunet!questrel!chris (Chris Cole)
  350. Subject: rec.puzzles FAQ, part 11 of 15
  351. Message-ID: <puzzles-faq-11_717034101@questrel.com>
  352. Followup-To: rec.puzzles
  353. Summary: This posting contains a list of
  354.      Frequently Asked Questions (and their answers).
  355.      It should be read by anyone who wishes to
  356.      post to the rec.puzzles newsgroup.
  357. Sender: chris@questrel.com (Chris Cole)
  358. Reply-To: uunet!questrel!faql-comment
  359. Organization: Questrel, Inc.
  360. References: <puzzles-faq-1_717034101@questrel.com>
  361. Date: Mon, 21 Sep 1992 00:09:38 GMT
  362. Approved: news-answers-request@MIT.Edu
  363. Expires: Sat, 3 Apr 1993 00:08:21 GMT
  364. Lines: 1889
  365.  
  366. Archive-name: puzzles-faq/part11
  367. Last-modified: 1992/09/20
  368. Version: 3
  369.  
  370. ==> induction/hanoi.p <==
  371. Is there an algorithom for solving the hanoi tower puzzle for any number
  372. of towers?  Is there an equation for determining the minimum number of
  373. moves required to solve it, given a variable number of disks and towers?
  374.  
  375. ==> induction/hanoi.s <==
  376. The best way of thinking of the Towers of Hanoi problem is inductively.
  377. To move n disks from post 1 to post 2, first move (n-1) disks
  378. from post 1 to post 3, then move disk n from post 1 to post 2, then move
  379. (n-1) disks from post 3 to post 2 (same procedure as moving (n-1) disks
  380. from post 1 to post 3).  In order to figure out how to move (n-1) disks
  381. from post 1 to post 3, first move (n-2) disks . . . .
  382.  
  383. As far as an algorithm which straightens out any legal position is
  384. concerned, the algorithm would go something like this:
  385.  
  386. 1.  Find the smallest disk.  Call the post that it's on post 1.
  387.  
  388. 2.  Find the smallest disk which is not on post 1.  This disk is, say,
  389. size k.  (I am calling the smallest disk size 1 here.)  Call the post
  390. that disk k is on post 2.  Disks 1 through (k-1) are then all stacked up
  391. correctly on post 1 disk k is on top of post 2.  This follow from the
  392. fact that the disks are in a legal postition.
  393.  
  394. 3.  Move disks 1 through (k-1) from post 1 to post 2, ignoring the other
  395. disks.  This is just the standard Tower of Hanoi problem for (k-1)
  396. disks.
  397.  
  398. 4.  If the disks are not yet correctly arranged, repeat from step 1.
  399.  
  400. In fact, this gives the straightening with the fewest number of moves.
  401.  
  402. With 3 towers, for N number of disks, the formula for the minimum number of
  403. moves to complete the puzzle correctly is:
  404.         (2^N) - 1
  405.  
  406. This bit of ancient folklore was invented by De Parville in 1884.
  407.  
  408. ``In the great temple at Benares, says he, beneath the dome which
  409.   marks the centre of the world, rests a brass plate in which are
  410.   fixed three diamond needles, each a cubit high and as thick as
  411.   the body of a bee.  On one of these needles, at the creation,
  412.   God placed sixty-four discs of pure gold, the largest disc resting
  413.   on the brass plate, and the others getting smaller and smaller
  414.   up to the top one.  This is the Tower of Bramah.  Day and night
  415.   unceasingly the priests transfer the discs from one diamond needle
  416.   to another according to the fixed and immutable laws of Bramah,
  417.   which require that the priest on duty must not move more than one
  418.   disc at a time and that he must place this disc on a needle so
  419.   that there is no smaller disc below it.  When the sixty-four
  420.   discs shall have been thus transferred from the needle on which
  421.   at the creation God placed them to one of the other needles,
  422.   tower, temple, and Brahmins alike will crumble into dust, and
  423.   with a thunderclap the world will vanish.''  (W W R Ball,
  424.   MATHEMATICAL RECREATIONS AND ESSAYS, p. 304)
  425.  
  426. This has been discussed by several authors, e.g.
  427.  
  428.     Er, Info Sci 42 (1987) 137-141.
  429.     Graham, Knuth and Patashnik, _Concrete_Mathematics_.
  430.  
  431. There are many papers claiming to solve this, and they are probably
  432. all correct but they rely on the unproven "Frame's conjecture".
  433. In particular, for the 4 peg case the conjecture states that an optimal
  434. solution begins by forming a substack of the k smallest discs, then moving
  435. the rest, and then moving those k again; k to be determined.
  436.  
  437. Here is a extensible bc program that does the same work. The output
  438. format is not that great. We get 300 numbers as output. The first
  439. hundred represent N, the next 100 represent f(N) and the last hundred
  440. represent i, which is the number of discs to move to tmp1 using f(N).
  441. For convenience, I have here some values for N <= 48. Enjoy.
  442.  
  443. Sharma
  444.  
  445.  
  446. N     1   2   3  4  5   6  7  8  9  10  11 12 13  14  15  16  17  18  19
  447. f(N)     1   3   5  9 13  17 25 33 41  49  65 81 97 113 129 161 193 225 257
  448. i     0   1   1  2  2   3  3  4  5   6   6  7  8   9  10  10  11  12  13
  449.  
  450.  
  451. N    20   21  22  23  24  25  26  27  28  29  30   31   32   33   34   35
  452. f(N)    289 321 385 449 513 577 641 705 769 897 1025 1153 1281 1409 1537 1665
  453. i    14   15  15  16  17  18  19  20  21  21   22   23   24   25   26   27
  454.  
  455. N    36    37    38    39     40    41   42   43   44   45   46   47   48
  456. f(N)    1793 2049  2305  2561   2817  3073 3329 3585 3841 4097 4609 5121 5633
  457. i    28    28    29    30     31    32    33   34   35   36  36   37   38
  458.  
  459.  
  460. /* This is the bc program that gives f(N) for 4 peg case */
  461.  
  462. w = 101; /* This represents the number of disks */
  463.  
  464. m[0] = 0;
  465. m[1] = 1;
  466. m[2] = 3;
  467. m[3] = 5;
  468. m[4] = 9;
  469. m[5] = 13;
  470. m[6] = 17;
  471.  
  472. /* f(n) is the function that gives the min # of moves for 4 peg case */
  473. define f(n) {
  474.   return (m[n]);
  475. }
  476.  
  477. /* g(n) is the function that fives the min # of moves for 3 peg case */
  478. define g(n) {
  479.   return (2^n - 1);
  480. }
  481.  
  482. /* x(n) is the Optimization Routine */
  483.  
  484. define x(n) {
  485.   auto j
  486.   auto r
  487.   auto i
  488.  
  489.   if(n == 1) return (1);
  490.   j = f(1) + g(n-1);
  491.  
  492.   for(i = 2; i < n; i++) {
  493.     r = f(i) + g(n-i);
  494.     if(r < j) { j = r; d = i; }
  495.   }
  496.   return (j);
  497. }
  498.  
  499. /* main program */
  500. for(q = 4; q < w; q++) {
  501.   t = x(q-1);
  502.   m[q] = 2 * t + 1;
  503.   d[q] = d;
  504. };
  505.  
  506.  
  507. /*This for loop prints the number of discs from 1 <= n <=  w*/
  508.  
  509. for(q = 1; q < w; q++) {
  510. q;
  511. }
  512.  
  513. /*This for loop prints f(n) for 1 <= n <= w */
  514.  
  515. for(q = 1; q < w; q++) {
  516. m[q];
  517. }
  518.  
  519. /*This for loop prints i for 1 <= n <= w
  520. i represents the number of disks to be moved to tmp location using f(n)
  521. N-i-1 will be moved using g(n) */
  522.  
  523. for(q = 1; q < w; q++) {
  524. d[q];
  525. }
  526.  
  527. --
  528. sharma@sharma.warren.mentorg.com
  529.  
  530. ==> induction/n-sphere.p <==
  531. With what odds do three random points on an n-sphere form an acute triangle?
  532.  
  533. ==> induction/n-sphere.s <==
  534. Select three points a, b, and c, randomly with respect to the surface of an
  535. n-sphere.  These three points determine a fourth, x, which is the intersection
  536. of the sphere with the axis perpendicular to the abc plane.  (Choose the pole
  537. nearest the plane.) I could have, just as easily, selected x, a distance d
  538. from x, and three points d units away from x.  The distribution of d is not
  539. uniform, but that's ok.  For every x and d, the three points abc form an acute
  540. triangle with probability p[n-1].  By induction, p[n] = 1/4.
  541.  
  542. ==> induction/paradox.p <==
  543. What simple property holds for the first 10,000 integers, then fails?
  544.  
  545. ==> induction/paradox.s <==
  546. Consider the sequences defined by:
  547. s(1) = a; s(2) = b; s(n) = least integer such that s(n)/s(n-1) > s(n-1)/s(n-2).
  548. In other words, s(n) = 1+floor(s(n-1)^2/s(n-2)) for n >= 3.  These
  549. sequences are similar in some ways to the classically-studied Pisot
  550. sequences.  For example, if a = 1, b = 2, then we get the odd-indexed
  551. Fibonacci numbers.
  552.  
  553. D. Boyd of UBC, an expert in Pisot sequences, pointed out the following.
  554. If we let a = 8, b = 55 in the definition above, then the resulting
  555. sequence s(n) appears to satisfy the following linear recurrence
  556. of order 4:
  557.  
  558.     s(n) = 6s(n-1) + 7s(n-2) - 5s(n-3) - 6s(n-4)
  559.  
  560. Indeed, it does satisfy this linear recurrence for the
  561. first 11,056 terms.  However, it fails at the 11,057th term!
  562. And s(11057) is a 9270 digit number.
  563. (The reason for this coincidence depends on a remarkable fact
  564. about the absolute values of the roots of the polynomial
  565. x^4 - 6x^3 - 7x^2 + 5x + 6.)
  566.  
  567. ==> induction/party.p <==
  568. You're at a party.  Any two (different) people at the party have exactly one
  569. friend in common (the friend is also at the party).  Prove that there is at
  570. least one person at the party who is a friend of everyone else.  Assume that
  571. the friendship relation is symmetric and not reflexive.
  572.  
  573. ==> induction/party.s <==
  574. Here is an easy solution by induction. Let P be the set of people in the
  575. party, and n the size of P. If n=2 or 3, the result is trivial. Suppose now
  576. that n>3 and that the result is true for n-1.
  577.  
  578. For any two distinct x,y in P, write x & y to mean that `x is a friend of y',
  579. and x ~& y to mean that `x is not a friend of y'.
  580.  
  581. Take q in P. The hypothesis on the relation & is still satisfied on P-{q}; by
  582. induction, the result is thus true for P-{q}, and there is some p in P-{q}
  583. such that p & x for any x in P-{p,q}. We have two cases:
  584.  
  585. a) p & q. Then the result holds for P with p.
  586.  
  587. b) p ~& q. By hypothesis, there is a unique r in P-{p,q} such that p & r & q.
  588. For any x in P-{p,q}, if x & q, then p & x & q, and so x=r. Thus r is the
  589. unique friend of q. Now for any s in P-{q,r} there exists some x such that s &
  590. x & q, and so x=r. This means that r & s for any s in P-{q,r}, and as r & q,
  591. the results holds in P with r.
  592.  
  593. The problem can also be solved by applying the spectral theory of graphs
  594. (see for instance Bollobas' excellent book, _Extremal Graph Theory_).
  595.  
  596. The problem's condition is vacuous if there is only N=1 person at the "party",
  597. impossible if N=2 (If you aren't your own friend, nor I mine, somebody *else*
  598. must be our mutual friend), and trivial if N=3 (everybody must be everyone
  599. else's friend).  Henceforth assume N>3.
  600.  
  601. Let A,B be two friends, and C their mutual friend.  Let a be the number
  602. of A's friends other than B and C, and likewise b,c.  Each of A's friends
  603. is also friendly with exactly one other of A's friends, and with none of
  604. B and C's other friends (if A1,B1 are friends of A,B resp. and of each other
  605. then A1 and B have more than one mutual friend); likewise for B and C.
  606. Let M=N-(a+b+c+3) be the number of people not friendly with any of A,B,C.
  607. Each of them is friendly with exactly one of A's and one of B's friends;
  608. and each pair of a friend of A and a friend of B must have exactly
  609. one of them as a mutual friend.  Thus M=ab; likewise M=ab=ac=bc. Thus
  610. either M and two of a,b,c vanish, or a=b=c=k (say), M=k^2, and N=k^3+3k+3.
  611. In the first case, say b=c=0; necessarily a is even, and A is a friend of
  612. everybody else at the party, each of whom is friendly with exactly one other
  613. person; clearly any such configuration (a graph of k/2+1 triangles with a
  614. common vertex) satisfies the problem's conditions).
  615.  
  616. It remains to show that the second case is impossible.  Since N=k^2+3k+3
  617. does not depend on A,B,C, neither does k, and it quickly follows that the
  618. party's friendship graph is regular with reduced matrix
  619.  
  620.          [  0   k+2   0  ]
  621.          [  1    1    k  ]
  622.          [  0    1   k+1 ]
  623.  
  624. and eigenvalues k+2 and +-sqrt(k+1) and multiplicities 1,m1,m2 for some
  625. *integers* m1 and m2 such that (m1-m2)*sqrt(k+1)=-(k+2) (because the graph's
  626. matrix has trace zero).  Thus sqrt(k+1) divides k+2 and k+1 divides
  627.  
  628.         (k+2)^2=(k+1)(k+3)+1
  629.  
  630. which is only possible if k=0,  Q.E.D.
  631.  
  632. ==> induction/roll.p <==
  633. An ordinary die is thrown until the running total of the throws first
  634. exceeds 12.  What is the most likely final total that will be obtained?
  635.  
  636. ==> induction/roll.s <==
  637. Claim: If you throw a die until the running total exceeds n>=5, a final
  638. outcome of n+1 is more likely than any other.
  639.  
  640. Assume we throw an m for a total n+k>n+1, and assume m-k>=0.  Now, it
  641. is just as likely to throw an m as an m-k+1, which means that the sum
  642. n+1 is just as likely as any other.  Now consider the series of throws
  643. consisting of n-5 1's followed by a 6 and note that we cannot achieve
  644. more than an n+1 by changing the last die roll.  Hence, a total of n+1
  645. is more likely than any other.
  646.  
  647. ==> induction/takeover.p <==
  648. After graduating from college, you have taken an important managing position
  649. in the prestigious financial firm of "Mary and Lee".
  650. You are responsable for all the decisions concerning take-over bids.
  651. Your immediate concern is whether to take over "Financial Data".
  652. There is no doubt that you will be successful if you are the first to
  653. bid and that this will be profitable for the firm and you in the long
  654. run.  However, you know that there exist another n financial firms,
  655. similar to "Mary and Lee", that are also considering the possibility.
  656. Although you are likely to be the first one to move, you know that
  657. just after a take-over there is a lot of adjustment that needs to be
  658. done.  In fact, for a period of time following any take-over the
  659. successful firm becomes a prime candidate for a take-over which will
  660. cost the job of whoever is responsable for take-overs.  Among all
  661. financial firms it is common knowledge that the managers responsable
  662. for take-overs are rational and intelligent.  What is your best response?
  663.  
  664. ==> induction/takeover.s <==
  665. Assume the takeover is wise for n.  The takeover is then unwise for
  666. n+1, as the other companies now find themselves in the same situation
  667. as you for n.  If the decision is unwise for n, by similar reasoning
  668. it is wise to takeover FD for n+1.  Now note that for n=1 the takeover
  669. decision is clearly unwise, hence by induction you should takeover
  670. FD iff n is even.
  671.  
  672. ==> logic/29.p <==
  673. Three people check into a hotel.  They pay $30 to the manager and go
  674. to their room.  The manager finds out that the room rate is $25 and
  675. gives $5 to the bellboy to return.  On the way to the room the bellboy
  676. reasons that $5 would be difficult to share among three people so
  677. he pockets $2 and gives $1 to each person.
  678.  
  679. Now each person paid $10 and got back $1.  So they paid $9 each,
  680. totalling $27.  The bellboy has $2, totalling $29.
  681.  
  682. Where is the remaining dollar?
  683.  
  684. ==> logic/29.s <==
  685. Each person paid $9, totalling $27.  The manager has $25 and the bellboy $2.
  686. The bellboy's $2 should be added to the manager's $25 or subtracted from
  687. the tenants' $27, not added to the tenants' $27.
  688.  
  689. ==> logic/ages.p <==
  690. 1) Ten years from now Tim will be twice as old as Jane was when Mary was
  691.    nine times as old as Tim.
  692.  
  693. 2) Eight years ago, Mary was half as old as Jane will be when Jane is one year
  694.    older than Tim will be at the time when Mary will be five times as old as
  695.    Tim will be two years from now.
  696.